import { Pipe, PipeTransform, Injectable } from "@angular/core";
import { Route } from "@angular/router";
import { FilterModel, FilterType } from "./models/filter.model";

@Pipe({
    name: 'screening',
    pure: false
})
@Injectable()
export class ReportingPipe implements PipeTransform {
    transform(filters: FilterModel[], systemAndFavs: boolean) {
        return filters.filter(filter => systemAndFavs ?
            (filter.type == FilterType.Standard || filter.isFavorite) :
            (filter.type !== FilterType.Standard && !filter.isFavorite));
    }
}